package com.zhouyibike.uu.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.zhouyibike.uu.R;
import com.zhouyibike.uu.entity.LvMenuItem;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by Administrator on 2017/4/22 0022.
 */
public class WalletItemAdapter extends BaseAdapter {
    private Context mContext;

    public WalletItemAdapter(Context mContext) {
        this.mContext = mContext;
    }

    private List<LvMenuItem> mItems = new ArrayList<LvMenuItem>(
            Arrays.asList(
//                    new LvMenuItem(R.drawable.xingcheng_left, "我的行程"),
//                    new LvMenuItem(R.drawable.qianbao_left, "我的钱包"),
//                    new LvMenuItem(R.drawable.danche_left, "我的单车"),
//                    new LvMenuItem(R.drawable.yaoqing_left, "邀请分享"),
//                    new LvMenuItem(R.drawable.paiming_left, "骑车排名")

                    new LvMenuItem(R.drawable.chide121, "美食"),
                    new LvMenuItem(R.drawable.musice, "KTV"),
                    new LvMenuItem(R.drawable.zhuang121, "健身"),
                    new LvMenuItem(R.drawable.kafei, "咖啡")
                   //, new LvMenuItem(R.drawable.info_paiming, "兑换区")

                   , new LvMenuItem(R.drawable.car1111, "共享汽车"),
                    new LvMenuItem(R.drawable.meifa12, "美发")
                    //, new LvMenuItem(R.drawable.iconyioquan, "翼活动")
            ));


    @Override
    public int getCount() {
        return mItems.size();
    }


    @Override
    public Object getItem(int position) {
        return mItems.get(position);
    }


    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView = LayoutInflater.from(mContext).inflate(R.layout.adapter_newwallet_bottomitem, null);
        TextView tv_state = (TextView) convertView.findViewById(R.id.tv_left_state);
        ImageView iv_pic = (ImageView) convertView.findViewById(R.id.iv_left_img);
        TextView tv_name = (TextView) convertView.findViewById(R.id.tv_left_name);
        iv_pic.setImageResource(mItems.get(position).getIcon());
        tv_name.setText(mItems.get(position).getName());
        return convertView;
    }
}
